﻿@using Top.Api.Response;
@using HuiJiYunGo.EF;
@{
    Layout = "~/Views/Shared/_LayoutShow.cshtml";
    ViewBag.Title = "惠集云GO，优惠云集";
    var MaterialList = ViewBag.MaterialList as List<TbkDgOptimusMaterialResponse.MapDataDomain>;
    //var HaoQuan = ViewBag.HaoQuan as List<TbkDgOptimusMaterialResponse.MapDataDomain>;
    //var TeHui = ViewBag.TeHui as List<TbkDgOptimusMaterialResponse.MapDataDomain>;
    var CategoryTop10List = ViewBag.CategoryTop10List as List<CategoryLevelOneViewModel>;

    var SlideShowList = ViewBag.SlideShowList as List<SlideShow>;
}

<style>
    .title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
    }
</style>


<div class="category-con">
    <div class="category-inner-con w1200" onmouseover="categoryShow()" onmouseout="categoryHide()">
        <div class="category-type" >
            <h3>热卖分类</h3>
        </div>
        <div class="category-tab-content" id="categoryShow" style="display:none;">
            <div class="nav-con">
                <ul class="normal-nav layui-clear" style="z-index: 999;">
                    @foreach (var item in CategoryTop10List)
                    {
                        <li class="nav-item">
                            <div class="title">@item.shortname</div>
                            <p>
                                @foreach (var item2 in item.CategoryList)
                                {
                                    <a href="@item2.link">@item2.shortname</a>
                                }
                            </p>
                            <i class="layui-icon layui-icon-right"></i>
                        </li>
                    }
                    @*<li class="nav-item">
                            <div class="title">服饰鞋包</div>
                            <p>
                                <a href="#">女装</a>
                                <a href="#">男装</a>
                                <a href="#">内衣</a>
                                <a href="#">T恤</a>
                            </p>
                            <i class="layui-icon layui-icon-right"></i>
                        </li>
                        <li class="nav-item">
                            <div class="title">美食</div>
                            <p><a href="#">休闲食品</a><a href="#">元气早餐</a></p>
                            <i class="layui-icon layui-icon-right"></i>
                        </li>
                        <li class="nav-item">
                            <div class="title">美妆</div>
                            <p><a href="#">眼妆</a><a href="#">面膜</a></p>
                            <i class="layui-icon layui-icon-right"></i>
                        </li>
                        <li class="nav-item">
                            <div class="title">居家生活</div>
                            <p><a href="#">婴幼玩具</a><a href="#">日用品</a><a href="#">洗面奶</a></p>
                            <i class="layui-icon layui-icon-right"></i>
                        </li>
                        <li class="nav-item">
                            <div class="title">数码办公</div>
                            <p><a href="#">数码家电</a><a href="#">耳机</a></p>
                            <i class="layui-icon layui-icon-right"></i>
                        </li>*@

                </ul>
            </div>
        </div>
    </div>
    <div class="category-banner" @*style="background-color: #ee1d0f"*@>
        <div class="w1200">
            @*<img src="../Content/static/img/m7ldd.png" onclick="window.open('https://s.click.taobao.com/0FL6lyu')">*@
            <div class="layui-carousel" id="test1">
                <div carousel-item>
                    @foreach (var item in SlideShowList)
                    {
                    <div style="background: url(@item.Img_Src);no-repeat center; background-size: contain;background-size:100% 100%; " onclick="window.open('@item.Link_to')">
                        @*<img src="@item.Img_Src" onclick="window.open('@item.Link_to')" style="width: 100%; max-width: 100%;">*@
                    </div>
                    }
                    @*<div>条目1</div>
                        <div>条目2</div>
                        <div>条目3</div>
                        <div>条目4</div>
                        <div>条目5</div>*@
                </div>
            </div>
        </div>
    </div>
</div>
@*<div class="floors">
        <div class="sk">
            <div class="sk_inner w1200">
                <div class="sk_hd">
                    <a href="javascript:;">
                        <img src="../Content/static/img/s_img1.jpg">
                    </a>
                </div>
                <div class="sk_bd">
                    <div class="layui-carousel" id="test1">
                        <div carousel-item>
                            <div class="item-box">
                                @foreach (var item in HaoQuan.Take(4).ToList())
                                {
                                    <div class="item" onclick="window.location.href='@item.CouponClickUrl'">
                                        <a href="javascript:;"><img src="@item.PictUrl" style="width:190px;height:190px"></a>
                                        <div class="title" style="width:180px;">@item.ShortTitle</div>
                                        <div class="price">
                                            <span>￥@(decimal.Parse(item.ZkFinalPrice)- item.CouponAmount)</span>
                                            <del>￥@(item.ZkFinalPrice)</del>
                                        </div>
                                    </div>
                                }

                            </div>
                            <div class="item-box">
                                @foreach (var item in HaoQuan.Skip(4).ToList())
                                {
                                    <div class="item" onclick="window.location.href='@item.CouponClickUrl'">
                                        <a href="javascript:;"><img src="@item.PictUrl" style="width:190px;height:190px"></a>
                                        <div class="title" style="width:180px;">@item.ShortTitle</div>
                                        <div class="price">
                                            <span>￥@(decimal.Parse(item.ZkFinalPrice)- item.CouponAmount)</span>
                                            <del>￥@(item.ZkFinalPrice)</del>
                                        </div>
                                    </div>
                                }

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>*@









<div class="content content-nav-base buytoday-content">
    <div id="list-cont">
        <div class="product-list-box">
            <div class="product-list w1200">
                <h4 style="font-size: 30px; color: #333;padding-bottom:30px;padding-top:30px;">实时热销</h4>
                <div class="list-cont">
                    <div class="item-box layui-clear">
                        @foreach (var item in MaterialList)
                        {
                            <div class="item">
                                <img src="@item.PictUrl" alt="" style="width:290px;height:320px;">
                                <div class="text-box">
                                    <p class="title" style="width:280px;">@item.ShortTitle</p>
                                    <p class="plic">
                                        <span class="ciur-pic" style="color:crimson;">￥@(decimal.Parse(item.ZkFinalPrice)- item.CouponAmount)</span>
                                        <span class="Ori-pic">￥@(item.ZkFinalPrice)</span>
                                        <span class="discount" onclick="window.open('@item.CouponClickUrl')" style="width:92px;"> 领取@(item.CouponAmount)元券</span>
                                    </p>
                                </div>
                            </div>
                        }

                    </div>
                    <div id="demo0" style="text-align: center;"></div>
                </div>

            </div>
        </div>

    </div>
</div>



<script type="text/javascript">

        layui.config({
            base: '../Content/static/js/util/' //你存放新模块的目录，注意，不是layui的模块目录
        }).use(['mm', 'carousel', 'laypage','jquery'], function () {
            var carousel = layui.carousel, laypage = layui.laypage, $ = layui.$,
                mm = layui.mm;
            laypage.render({
                elem: 'demo0'
                , theme: '#f00582'
                , count: '@ViewBag.TotalCount' //数据总数
                , limit: '@ViewBag.Limit'
                , curr:'@ViewBag.Page'
                , jump: function (obj, first) {
                    //obj包含了当前分页的所有参数，比如：
                    console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                    console.log(obj.limit); //得到每页显示的条数

                    if (!first) {
                        window.location.href = "?page=" + obj.curr +"#list-cont";
                    }
                }
            });

            var option = {
                elem: '#test1'
                , width: '100%' //设置容器宽度
                , arrow: 'always'
                , height: '400'
                , indicator: 'none'
                , autoplay: true
            }
            carousel.render(option);
            // 模版引擎导入
            // var ins = carousel.render(option);
            // var html = demo.innerHTML;
            // var listCont = document.getElementById('list-cont');
            // // console.log(layui.router("#/about.html"))
            //  mm.request({
            //    url: '../json/index.json',
            //    success : function(res){
            //      console.log(res)
            //      listCont.innerHTML = mm.renderHtml(html,res)
            //      ins.reload(option);
            //    },
            //    error: function(res){
            //      console.log(res);
            //    }
            //  })


            window.categoryShow = function categoryShow() {
                $("#categoryShow").show();
            }

            window.categoryHide = function categoryHide() {
                $("#categoryShow").hide();
            }

        });
</script>

